package com.wonders.springcloud.zuul.controller;

import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/demo")
public class DemoController {
    @Resource
    DiscoveryClient client;
    @GetMapping("/sayhi")
    public String sayhi(){
        //ServiceInstance instance = client.getInstances("").get(0);
        //Integer r = a + b;
        //logger.info("/add, host:" + instance.getHost() + ", service_id:" + instance.getServiceId() + ", result:" + r);
        return "hello sam!";
    }
}
